package wumpusworld;

import java.util.Vector;

public class Square 

{	
	private boolean adjacent;
	private boolean wumpus;
	private boolean possiblyWumpus;
	private boolean pit;
	private boolean firstTime;
	private boolean possiblyPit;
	private boolean safe;
	private int stenchCount;
	private int breezeCount;
	private int ngbNb;
	
	
	public Square (int ngb)
	{	
		
		wumpus = false;
		firstTime = true;
		possiblyWumpus = false;
		adjacent = false;
		pit = false;
		possiblyPit = false;
		safe = false;
		stenchCount = 0;
		breezeCount = 0;
		ngbNb = ngb;
	}
		/******* getter and setter*****/ 
	public void incStench ()
	{
		stenchCount ++;
		if (stenchCount >=2)
		{
			wumpus = true;
		}
		
	}
	
	public void incBreeze ()
	{
		breezeCount++;
		if (breezeCount >=ngbNb || breezeCount >= 3)
		{
			pit = true;
		}
	}
	
	public int getNgbNbr()
	{
		return ngbNb;
	}
	
	public int getBreezeCount ()
	{
		return breezeCount;
	}
	
	public int getStenchCount ()
	{
		return stenchCount;
	}

	public boolean isWumpus() 
	{
		return wumpus;
	}

	public void setWumpus(boolean wumpus) 
	{
		this.wumpus = wumpus;
	}

	public boolean isPossiblyWumpus() 
	{
		return possiblyWumpus;
	}

	public void setPossiblyWumpus(boolean possiblyWumpus) 
	{	
		this.adjacent = true;
		this.possiblyWumpus = possiblyWumpus;
		if (possiblyWumpus)
		{
			incStench();
		}
	}

	public boolean isPit() 
	{
		return pit;
	}

	public void setPit(boolean pit) 
	{
		this.pit = pit;
	}

	public boolean isPossiblyPit() 
	{
		return possiblyPit;
	}

	public void setPossiblyPit(boolean possiblyPit) 
	{	
		this.adjacent = true;
		this.possiblyPit = possiblyPit;
		if (possiblyPit)
		{
			incBreeze();
		}
	}

	public boolean isSafe() 
	{
		return safe;
	}

	public void setSafe() 
	{	
		this.adjacent = true;
		this.safe = true;
		this.possiblyPit = false;
		this.pit= false;
		this.possiblyWumpus = false;
		this.wumpus = false;
	}
	
	public void noWumpus()
	{
		stenchCount = 0;
		possiblyWumpus = false;
	}
	
	public boolean isFirstTime() 
	{
		return firstTime;
	}
	
	public void setFirstTime(boolean firstTime) 
	{
		this.firstTime = firstTime;
	}
	
	public boolean isAdjacent() 
	{
		return adjacent;
	}
	
	public void setAdjacent(boolean adjacent) 
	{
		this.adjacent = adjacent;
	}
	  
}
